import {
    Row,
    Col,
    Form,
    Input,
    Select,
    Modal,
} from 'antd';

const FormItem = Form.Item;
const { Option } = Select;



//新增表单
const CreateForm = Form.create()(props => {
    const { modalVisible, form, handleAdd, handleModalVisible } = props;
const okHandle = () => {
    form.validateFields((err, fieldsValue) => {
        if (err) return;
    form.resetFields();
    handleAdd(fieldsValue);
});
};
return (
    <Modal
width={800}
destroyOnClose
title="新增"
visible={modalVisible}
onOk={okHandle}
onCancel={() => handleModalVisible()}
>
<Form  layout="vertical">

    <Row gutter={{ md: 8, lg: 24, xl: 48 }}>
				

        <Col  md={12} sm={24}>
        
        <FormItem  label="名称">
            {form.getFieldDecorator('tablename', {
            rules: [{ required: true, message: '请输入名称！', min: 1 }],
            })(<Input placeholder="请输入" />)}
        </FormItem>
        </Col>
								
        <Col  md={12} sm={24}>
        <FormItem  label="列名称">
            {form.getFieldDecorator('columnname', {
            rules: [{ required: true, message: '请输入列名称！', min: 1 }],
            })(<Input placeholder="请输入" />)}
        </FormItem>
        </Col>
        
    </Row>

    <Row gutter={{ md: 8, lg: 24, xl: 48 }}>



        <Col  md={12} sm={24}>
        <FormItem  label="列编码">
            {form.getFieldDecorator('columncode', {
            rules: [{ required: true, message: '请输入列编码！', min: 1 }],
            })(<Input placeholder="请输入" />)}
        </FormItem>
        </Col>
				
        <Col  md={12} sm={24}>
        <FormItem  label="列类型">
            {form.getFieldDecorator('columntype', {
            rules: [{ required: false, message: '请输入列类型！', min: 1 }],
            })(<Input placeholder="请输入" />)}
        </FormItem>
        </Col>
        
    </Row>

    <Row gutter={{ md: 8, lg: 24, xl: 48 }}>
	

        				
        <Col  md={12} sm={24}>
        <FormItem  label="列长度">
            {form.getFieldDecorator('columnlength', {
            rules: [{ required: false, message: '请输入列长度！', min: 1 }],
            })(<Input placeholder="请输入" />)}
        </FormItem>
        </Col>
				
				        
        <Col  md={12} sm={24}>
        <FormItem  label="列顺序">
            {form.getFieldDecorator('columnsequence', {
            	rules: [{ required: false, message: '请输入列顺序！', min: 1 }],
            })(<Input placeholder="请输入" />)}
        </FormItem>
        </Col>


    </Row>
    <Row gutter={{ md: 8, lg: 24, xl: 48 }}>
        <Col md={12} sm={24}>
        <FormItem label="是否显示">
            {form.getFieldDecorator('display',{
            	rules: [{ required: true, message: '请选择是否显示！'}],
            })(
                <Select placeholder="请选择" style={{ width: '100%' }}>
                        <Option value="0">否</Option>
                        <Option value="1">是</Option>
                        
                </Select>
            )}
        </FormItem>
        </Col>
  	</Row>
</Form>
</Modal>
);
});

export default CreateForm;

